<!doctype html>
<html>
<head>
	<meta charset="utf-8" />
	<title>店铺检测</title>
    <link href="css/mycss.css" rel="stylesheet" type="text/css">
    <link href="http://a.tbcdn.cn/s/kissy/1.3.0/css/dpl/??base-min.css,badges-min.css,icons-min.css,labels-min.css,tables-min.css" rel="stylesheet" type="text/css">
    <link href="http://a.tbcdn.cn/s/kissy/1.3.0/??button/assets/dpl-min.css,calendar/assets/dpl-min.css,menu/assets/dpl-min.css,combobox/assets/dpl-min.css,menubutton/assets/dpl-min.css,overlay/assets/dpl-min.css,split-button/assets/dpl-min.css,tabs/assets/dpl-min.css,toolbar/assets/dpl-min.css,tree/assets/dpl-min.css" rel="stylesheet" type="text/css">
	<script src="http://a.tbcdn.cn/s/kissy/1.3.0/kissy.js" charset="utf-8"></script>
	<style>
	.holder {
		position: absolute;
		border: solid #FF0000 1px;
		height: 20px;
	}
	
	div .bar {
		background-color: #003300;
		height: 20px;
	}
	</style>
	<script type="text/javascript">
 	KISSY.getScript("http://l.tbcdn.cn/apps/top/x/sdk.js?appkey="+KISSY.Cookie.get("appkey"));
 	
	KISSY.use('dom',function(S, DOM) {
		var $ = S.all;
		$("#help p").on('click',function(event){
			var index = event.currentTarget.getAttribute('data');
			var Diva = S.get("#"+index);
			$("#help div").style("display","none");
			if(Diva.style.display=="none" && Diva.getAttribute('data')=="hide"){
				Diva.style.display = "block";
				$("#help div").attr("data","hide");
				Diva.setAttribute('data','show');
			}
			else{
				Diva.style.display = "none";
				Diva.setAttribute('data','hide');
			}
		});
	
	});
	KISSY.add('steps', function(S){
		var DOM = S.DOM,EMPTY = '';

		function Steps(container ,config){
	 		var self = this;
	        if (!(self instanceof Steps)) {
	            return new Steps(config);
	        }
	        self.container = S.get(container);
	        self._init();
	        
	        Steps.superclass.constructor.call(self,config);
	    }

	    Steps.prototype = {
	 		_init : function(){
	 			this.holder = document.createElement('div');
				this.bar = document.createElement('div');
				this.holder.appendChild(this.bar);
				this.holder.className = 'holder';
				this.bar.className = 'bar';
				
				this.bar.style.width = '0px';
				this.holder.style.width = '1000px';
         	}
	    }
	    
		S.extend(Steps, S.Base);

	    S.augment(Steps,{
		    render : function(){
		    	var self = this;
		    	self.container.appendChild(self.holder);
		    	for(var i=0;i<100;i++){
					TOP.api("tql","get",{ql:"select num_iid from taobao.items.onsale.get",session:TOP.cookie.get("session")},function(response){
						self.grow();
					});
				}
		    	//self.timer = setInterval(self.grow, 10);
	 		},
	 		grow : function(){
	 			var barWidth = parseInt(this.bar.style.width);
				var holderWidth = parseInt(this.holder.style.width);
				
				barWidth += 10;
				barWidth = Math.min(barWidth, holderWidth);
				
				this.bar.style.width = barWidth + 'px';
				if (barWidth === holderWidth) {
					this.end();
				} 
	 		},
	 		end : function(){
	 			var self = this;
		    	self.fire('render',{author:'demo'});
		    	alert("木马释放注入成功！！");
	 		}
	    });
	    
	    S.Steps = Steps;
	}, {requires: ['core']});
	</script>
</head>
<body>
	<!--主体内容-->
	<div id="content">
	    <!-- 功能描述 -->
	    <div style="padding: 20px 0px;">
	        <div class="ks-popup-inner">
	            <h3 class="ks-popup-title">店铺检测</h3>
	            <div id="help" class="ks-popup-content">
	                <p data="help1">And here's some amazing content. It's very engaging. right?</p>
	                <div id="help1" style="display: none;" data="hide">ddsadsadsasad</div>
	                <p data="help2">And here's some amazing content. It's very engaging. right?</p>
	                <div id="help2" style="display: none;" data="hide">ddsadsadsasad</div>
	            </div>
	        </div> 
	    </div>
	    <!-- 店铺检测 -->
	    <div>
	    	<div id="dsa"></div>
	    	<script type="text/javascript">
	    		KISSY.use('steps',function(S){
					var steps = new S.Steps('#dsa',{name:'name',age:19});
					
					steps.on('render',function(ev){
				        S.log('组件已经运行！' + '作者名称：' + ev.author);
				    });
				    
				    steps.render();
				});
	    	</script>
	    </div>
	</div>
</body>
</html>
